package com.fandy.struts.DAL;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.fandy.struts.SqlAccess.SqlServerHelper;
import com.fandy.struts.SqlStatement.GoodsInfo;




public class DALGoodsInfo {

	SqlServerHelper ssh = new SqlServerHelper();

	GoodsInfo gi = new GoodsInfo();
 
	public   ResultSet GetGoodsByID(com.fandy.struts.Model.GoodsInfo  gifo)
	{
		return ssh.executeScalar(gi.GetGoodsByID(gifo));
	}
	
	 
	
	
	
	
	public   ResultSet GetGoodsByID(int  gID)
	{
		return ssh.executeScalar(gi.GetGoodsByID(gID));
	}
	
	public   ResultSet GetAllGoodsInfo()
	{
		return  ssh.executeScalar(gi.GetAllGoodsInfo());
	}
	
	public   ResultSet Search(String keyword )
	{
		return  ssh.executeScalar(gi.search(keyword));
	}
	
	
	public int Add(com.fandy.struts.Model.GoodsInfo gifo) throws SQLException
	{
		
		return  ssh.executeNoQuery(gi.Add(gifo));
	}
	
	
	public   int UpdatebyID(int GoodsID,com.fandy.struts.Model.GoodsInfo gifo) throws SQLException
	{
		return ssh.executeNoQuery(gi.UpdatebyID(GoodsID, gifo));  
	}
	
	
	public int DeleteByID(int id) throws SQLException
	{
		
		return ssh.executeNoQuery(gi.DeleteByID(id));
		
	}
	
	
}
